http-client: support CIDR in no_proxy - #2495
Open
silverwind wants to merge 3 commits into
Open
silverwind wants to merge 3 commits into
silverwind wants to merge 3 commits into
Conversation
Entries like 10.0.0.0/8 were compared as plain strings, so requests to IP hosts in such ranges went through the proxy even though curl, Go and most other clients bypass it. Co-Authored-By: Claude (Opus 5) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Reject malformed CIDR entries containing extra path components.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds IPv4 and IPv6 CIDR support to no_proxy handling in the HTTP client.
Changes:
- Uses Node’s
BlockListfor CIDR matching. - Adds tests for valid and invalid CIDR entries.
File summaries
| File | Description |
|---|---|
packages/http-client/src/proxy.ts |
Implements CIDR-based proxy bypass matching. |
packages/http-client/__tests__/proxy.test.ts |
Tests IPv4/IPv6 CIDR behavior. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
An entry like 10.0.0.0/8/x was matched as 10.0.0.0/8. Co-Authored-By: Claude (Opus 5) <noreply@anthropic.com>
silverwind
commented
Sep 15, 2026
no_proxyno_proxy
Sirherobrine23
pushed a commit
to Sirherobrine23/gitea-runner
that referenced
this pull request
Sep 24, 2026
Make cache requests go through the runner and remove outbound traffic from the cache server. The runner forwards them to `cache.external_server` when one is set, and attaches itself to each job network so jobs can reach it. Benefits: 1. Jobs need no http proxy rules for the cache server, which `@actions/http-client` mishandles for CIDR ranges in `no_proxy` (actions/toolkit#2495). 2. Only runners reach a shared cache server, which needs no route to Gitea. 3. A runner container sharing the host Docker socket now caches, where jobs previously could not reach it. Breaks: 1. Jobs that reach `external_server` but not their runner, such as a remote `DOCKER_HOST`. The built-in cache has always needed that reachability, so both modes now agree. Set `cache.host` and `cache.port` to an address those jobs reach. 2. Jobs on `container.network: bridge`, where Docker rejects the alias, so the runner cannot attach and their cache fails as it does today. Leave `container.network` empty, or name a user-defined network. *Written by Claude.* --------- Co-authored-by: bircni <bircni@icloud.com> Reviewed-on: https://gitea.com/gitea/runner/pulls/1229 Reviewed-by: bircni <bircni@icloud.com> Co-authored-by: silverwind <2021+silverwind@noreply.gitea.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support CIDR syntax in the
no_proxyparsing ofhttp-client.The best "spec" on this topic is https://about.gitlab.com/blog/we-need-to-talk-no-proxy/ which shows the go and ruby parsers and probably others support CIDR in
no_proxyand I have a specific use case where this broke when having10.0.0.0/8insideno_proxy.Created with assistance of Claude Opus 5 and GPT 6 Astra.